/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef __LIB3D_NODE_FACTORY_H__
#define __LIB3D_NODE_FACTORY_H__

#include <map>
#include <Atom.h>
#include <safe_new.h>

namespace liba
{
namespace lib3d
{
namespace node
{
class Node;

class Factory
{
public:
	static Node * create( Node * scene_root, const Atom & object_type, const Atom & name = Atom() );

	typedef Node * (*MakeFun)(Node * scene_root, const Atom & name );
	typedef std::map<Atom, MakeFun> FactoryMap;

	static void add(const Atom & type_name, MakeFun make_fun );
	static void remove( const Atom & type_name );
private:
	static FactoryMap * factory_map;
};


} // namespace node
} // namespace lib3d
} // namespace liba
using namespace liba;

#endif //__LIB3D_NODE_FACTORY_H__